package toDo.app.models;

import java.util.Calendar;

public class TimeAuthority {

	public static int componentTimeToTimestamp(int year, int month, int day, int hour, int minute, int second) {
		Calendar c = Calendar.getInstance();
		c.set(year, month, day, hour, minute, second);
		return (int) (c.getTimeInMillis() / 1000000L);
	}

	public static String timeStampToComponent(int time) {
		Calendar c = Calendar.getInstance();
		c.setTimeInMillis(time * 1000000L); 
		return c.get(Calendar.DAY_OF_MONTH) + "/" + (c.get(Calendar.MONTH) + 1) + "/" + c.get(Calendar.YEAR);
	}

	public static String componentTimeToString(int year, int monthOfYear, int dayOfMonth){
		return (monthOfYear+1)+"/"+dayOfMonth + "/" + year;
	}
}
